use std::io;
fn main() {
    let _sum = 5 + 10;
    let _floating_x = 2.0;
    let _floating_y32: f32 = 2.0;
    let mut _t = true;
    _t = false;
    // println!("123{}", _t);
    let _heart_eyed_cat = '😻';
    tuple();
    array();
    exmple();
}
fn tuple() {
    let tup: (u16, f64, i8) = (600, 6.4, -1);
    let (x, y, z) = tup;
    println!("x{}y{}z{}", x, y, z);
    println!("x{}y{}z{}", tup.0, tup.1, tup.2);
}
fn array() {
    let a = [1, 2, 3, 4, 5];
    let a: [i32; 5] = [-1, -2, -3, -4, -5];
    let c = [-1; 5];
    println!("{}", c[0])
}
fn exmple() {
    println!("这里开始进行例子");
    let a = [1, 2, 3, 4, 5];
    println!("Please enter an array index.");
    let mut index = String::new();
    io::stdin()
        .read_line(&mut index)
        .expect("Failed to read line");
    let index: usize = index.trim().parse().expect("不是一个数字");
    let item = a[index];
    print!("这个是获取的数组的值arr[{}],{}", index, item);
}
